<?php

namespace App\Libs\Tools\Excel;

abstract class ExcelImport
{
    protected $titles=[];

    protected $results=[];

    abstract public function verify();

    abstract public function convert_results_data();

    public function convert($array){
        foreach ($array as $key=>$values){
            if($key==0){continue;}
            $result=[];
            foreach($this->titles as $tk=>$title){
                if(isset($values[$tk])){
                    $result[$title]=$values[$tk];
                }
            }
            array_push($this->results,$result);
        }
        return $this;
    }


    public function getResults(){
        return $this->results;
    }
}